<?php

use Workerman\Worker;
use Workerman\Crontab\Crontab;
require __DIR__ . '/vendor/autoload.php';

date_default_timezone_set('PRC');

$worker = new Worker();

$worker->onWorkerStart = function($worker)
{
    // 每 1 秒执行一次
    new Crontab('*/1 * * * * *', function(){
        echo date('Y-m-d H:i:s')."\n";
    });
};

Worker::runAll();